using Newtonsoft.Json;

namespace WWB.DisqusSharp.Model.DisqusDTO
{
    public abstract class DisqusAuthorBase
    {
        [JsonIgnore]
        public abstract string Named { get; }

        [JsonProperty("email_hash")]
        public string EmailHash { get; set; }

        [JsonProperty("url")]
        public string Url { get; set; }

        [JsonProperty("email")]
        public string Email { get; set; }

    }

    public class DisqusAnonymousAuthor : DisqusAuthorBase
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        #region Overrides of DisqusAuthorBase

        public override string Named
        {
            get { return Name; }
        }

        #endregion
    }

    public class DisqusKnownAuthor : DisqusAuthorBase
    { 
        [JsonProperty("username")]
        public string UserName { get; set; }


        [JsonProperty("display_name")]
        public string DisplayName { get; set; }


        [JsonProperty("has_avatar")]
        public bool HasAvatar { get; set; }


        [JsonProperty("avatar")]
        public AvatarPhotoLinks AvatarPhotos { get; set; }


        [JsonProperty("id")]
        public string Id { get; set; }

        #region Overrides of DisqusAuthorBase

        public override string Named
        {
            get { return UserName; }
        }

        #endregion
    }

}